var fs = require('fs')
var logPath = './log/';
var p1 = new Promise(function(resolve, reject){
	fs.readFile(logPath + 'a.log', 'utf8', function(err, data){
		if (err) {
			reject(err)
		}else{
			resolve(data)
		}
	})
})

var p2 = new Promise(function(resolve, reject){
	fs.readFile(logPath + 'b.log', 'utf8', function(err, data){
		if (err) {
			reject(err)
		}else{
			resolve(data)
		}
	})
})

var p3 = new Promise(function(resolve, reject){
	fs.readFile(logPath + 'c.log', 'utf8', function(err, data){
		if (err) {
			reject(err)
		}else{
			resolve(data)
		}
	})
})

p1
	.then((data)=>{
		console.log(data)
		return p2
	},(err)=>console.log('读取文件失败了', err))
	.then((data)=>{
		console.log(data)
		return p3
	},(err)=>console.log('读取文件失败了', err))
	.then((data)=>console.log(data),(err)=>console.log('读取文件失败了', err))
